﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>合同信息管理</title>
    <link href="../themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../themes/icon.css" rel="stylesheet" type="text/css" />

    <script src="../JScript/jquery-1.6.min.js" type="text/javascript"></script>

    <script src="../JScript/jquery.easyui.min.js" type="text/javascript"></script>

    <script src="../JScript/easyui-lang-zh_CN.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function() {           
            $('#div_tab').tabs({
                onSelect: function(title) {
                    if (title == "合同主体信息" && ($('#iframe_subject').attr("src") == null) || $('#iframe_subject').attr("src") == "") {
                        $('#iframe_subject').attr("src", "ContractsSubjectInfo.htm?type=detail");
                    }
                    else if (title == "合同委外信息" && ($('#iframe_outsourcing').attr("src") == null) || $('#iframe_outsourcing').attr("src") == "") {
                        $('#iframe_outsourcing').attr("src", "ContractsOutsourcingInfo.htm?type=detail");
                    }
                    else if (title == "合同客户信息" && ($('#iframe_client').attr("src") == null || $('#iframe_client').attr("src") == "")) {
                        $('#iframe_client').attr("src", "ContractsClientInfo.htm?type=detail");
                    }
                }
            });
        });
        var contractsInfoManager = {
            addTab: function(subtitle, url, icon) {
                if (!icon) icon = 'icon-edit';
                var tabCount = $('#div_tab').tabs('tabs').length; // 获取当前打开窗口总数量
                var hasTab = $('#div_tab').tabs('exists', subtitle); //根据名称判断窗口是否已打开
                if (!hasTab) {
                    $('#div_tab').tabs('add', {
                        title: subtitle,
                        content: createFrame(url),
                        closable: true,
                        icon: icon
                    });
                } else {
                    $('#div_tab').tabs('select', subtitle);
                    $('#mm-tabupdate').click();
                }
            }
        };
        function createFrame(url) {
            var s = '<iframe scrolling="auto" frameborder="0"  src="' + url + '"></iframe>';
            return s;
        }               
    </script>

    <style type="text/css">
        body
        {
            margin: 1px;
            width: 99%;
            height: 100%;
        }
        iframe
        {
            width: 100%;
            height: 780px;
        }
    </style>
</head>
<body>
    <div class="easyui-tabs" id="div_tab">
        <div class="" title="合同主体信息">
            <iframe id="iframe_subject" scrolling="auto"></iframe>
        </div>
        <div class="" title="合同委外信息">
            <iframe scrolling="auto" id="iframe_outsourcing"></iframe>
        </div>
        <div class="" title="合同客户信息">
            <iframe scrolling="auto" id="iframe_client"></iframe>
        </div>
    </div>
</body>
</html>
